home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
rettig.arc
/
TRSOURCE.EXE
/
_TR_PUTC.ASM
< prev
next >
Wrap
Assembly Source File
|
1990-10-22
|
1KB
|
46 lines
; __TR_PUTC.ASM
;
; by Ralph Davis, Leonard Zerman
;
; Placed in the public domain by Tom Rettig Associates, 10/22/1990.
;
PUBLIC __TR_PUTCH
;*******************************
_TR_PUTC_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TR_PUTC_TEXT
;-------------------------------
__TR_PUTCH PROC FAR
;
; SYNTAX: _tr_putch( c );
;
; char c;
;
;--------------------
PUSH BP
MOV BP,SP
MOV DX,[BP+6] ; Pick up character passed?
CMP DX,0AH ; '\n' (newline?)
JNE PUTCH1 ; No, just output the character
PUSH DX ; Yes, so save line feed (0AH)
MOV DL,0DH ; and output carriage return (0DH)
MOV AH,2 ; Print character in DL
INT 21H
POP DX ; Retrieve line feed
MOV AH,2 ; and output it
INT 21H
JMP SHORT PUTCH_RET
PUTCH1:
MOV AH,2
INT 21H
PUTCH_RET:
POP BP
RET
__TR_PUTCH ENDP
;-----------------------------
_TR_PUTC_TEXT ENDS
;*****************************
END